package site.shihuan.helpdesk.auth.exception;

import site.shihuan.helpdesk.common.model.IResultCode;

/**
 * ResultCode.
 *
 * @author 周世焕
 * @Date 2021/1/24 17:36
 */
public enum AuthResultCode implements IResultCode {

    UNAME_OR_PWD_WRONG(1001,"用户名或密码错误"),
    LIMIT_FREQUENCY(1002,"尝试次数过于频繁"),
    EMAIL_EXISTS(1003,"该邮箱已被占用"),
    EMAIL_FORMAT_INVALID(1004,"邮箱格式错误"),
    MOBILE_FORMAT_INVALID(1005,"手机号格式错误"),
    PWD_FORMAT_INVALID(1006,"密码格式错误");

    AuthResultCode(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    private int code;

    private String msg;

    /**
     * Get the result code.
     *
     * @return code value.
     */
    @Override
    public int getCode() {
        return code;
    }

    /**
     * Get the result code's message.
     *
     * @return code's message.
     */
    @Override
    public String getCodeMsg() {
        return msg;
    }
}
